package com.hmall.order.web;

import com.hmall.order.pojo.Order;
import com.hmall.order.pojo.OrderDTO;
import com.hmall.order.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("order")
public class OrderController {

    @Autowired
    private IOrderService orderService;

    @GetMapping("{id}")
    public Order queryOrderById(@PathVariable("id") Long orderId) {
        return orderService.getById(orderId);
    }
/**
* @Auth: wangxinglong
* @desc:新增订单业务
* @Date: 2023/7/1 9:59
*/
    @PostMapping
    public Long insert(@RequestBody OrderDTO orderDTO) {
        return orderService.insert(orderDTO);
    }
}
